package com.edu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 教材发放批次表
 * @TableName textbook_batch
 */
@TableName(value ="textbook_batch")
@Data
public class TextbookBatch {
    /**
     * 批次ID
     */
    @TableId(type = IdType.AUTO)
    private Long batchId;

    /**
     * 批次编号
     */
    private String batchCode;

    /**
     * 学期
     */
    private String semester;

    /**
     * 批次名称
     */
    private String batchName;

    /**
     * 总发放数量
     */
    private Integer totalQuantity;

    /**
     * 已发放数量
     */
    private Integer issuedQuantity;

    /**
     * 状态
     */
    private Object batchStatus;

    /**
     * 开始发放日期
     */
    private Date startDate;

    /**
     * 结束发放日期
     */
    private Date endDate;

    /**
     * 负责教师ID
     */
    private Long responsibleTeacher;

    /**
     * 批次备注
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TextbookBatch other = (TextbookBatch) that;
        return (this.getBatchId() == null ? other.getBatchId() == null : this.getBatchId().equals(other.getBatchId()))
            && (this.getBatchCode() == null ? other.getBatchCode() == null : this.getBatchCode().equals(other.getBatchCode()))
            && (this.getSemester() == null ? other.getSemester() == null : this.getSemester().equals(other.getSemester()))
            && (this.getBatchName() == null ? other.getBatchName() == null : this.getBatchName().equals(other.getBatchName()))
            && (this.getTotalQuantity() == null ? other.getTotalQuantity() == null : this.getTotalQuantity().equals(other.getTotalQuantity()))
            && (this.getIssuedQuantity() == null ? other.getIssuedQuantity() == null : this.getIssuedQuantity().equals(other.getIssuedQuantity()))
            && (this.getBatchStatus() == null ? other.getBatchStatus() == null : this.getBatchStatus().equals(other.getBatchStatus()))
            && (this.getStartDate() == null ? other.getStartDate() == null : this.getStartDate().equals(other.getStartDate()))
            && (this.getEndDate() == null ? other.getEndDate() == null : this.getEndDate().equals(other.getEndDate()))
            && (this.getResponsibleTeacher() == null ? other.getResponsibleTeacher() == null : this.getResponsibleTeacher().equals(other.getResponsibleTeacher()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBatchId() == null) ? 0 : getBatchId().hashCode());
        result = prime * result + ((getBatchCode() == null) ? 0 : getBatchCode().hashCode());
        result = prime * result + ((getSemester() == null) ? 0 : getSemester().hashCode());
        result = prime * result + ((getBatchName() == null) ? 0 : getBatchName().hashCode());
        result = prime * result + ((getTotalQuantity() == null) ? 0 : getTotalQuantity().hashCode());
        result = prime * result + ((getIssuedQuantity() == null) ? 0 : getIssuedQuantity().hashCode());
        result = prime * result + ((getBatchStatus() == null) ? 0 : getBatchStatus().hashCode());
        result = prime * result + ((getStartDate() == null) ? 0 : getStartDate().hashCode());
        result = prime * result + ((getEndDate() == null) ? 0 : getEndDate().hashCode());
        result = prime * result + ((getResponsibleTeacher() == null) ? 0 : getResponsibleTeacher().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", batchId=").append(batchId);
        sb.append(", batchCode=").append(batchCode);
        sb.append(", semester=").append(semester);
        sb.append(", batchName=").append(batchName);
        sb.append(", totalQuantity=").append(totalQuantity);
        sb.append(", issuedQuantity=").append(issuedQuantity);
        sb.append(", batchStatus=").append(batchStatus);
        sb.append(", startDate=").append(startDate);
        sb.append(", endDate=").append(endDate);
        sb.append(", responsibleTeacher=").append(responsibleTeacher);
        sb.append(", remark=").append(remark);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}